<?php
session_start();
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


Class Inetbilet
{
#var $domain_url="http://arm.frontmanager.com.ua";
#var $domain_url="http://internet-bilet.ua";    
#var $partnerKey="003049d933aaddec89cc38b9a5c56b05";
#var $login="info_kas1";
#var $password="info_kassa";
var $auth;
	function Inetbilet()
	{
          
		#$result_xml=$this->connect($this->domain_url.'/GetPartnerEventsCommand.cmd',"__auth=".$this->auth."&__pid=".$this->__pid."&format=xml&OnlyPrintable=1");
		#."&from=".date('Ymd',strtotime("-1 months"))."&to=".date('Ymd',strtotime("+1 month"))
		#."&to=".date('Ymd',strtotime("+3 months")
		#print_r($this->parse_karabas_xml($result_xml));
		
		
	}
	/*function connect_get($url)
	{
	
		if( $curl = curl_init() ) 
		{
                 #   die($url);
		curl_setopt($curl, CURLOPT_URL, $url);
		curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
		curl_setopt($curl, CURLOPT_GET, true);
		#curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
		$out = curl_exec($curl);
		curl_close($curl);
		return $out;
		}
	}*/
        function show_event_info($id)
        {
        $html='<!-- internet bilet -->';
        #onclick='window.open(\"http://internet-bilet.ua/events/item.html?event_id=".$event->field_inet_bilet_value."&partner=infopark\")'
        $html.='<a onclick="_gaq.push([\'_trackEvent\', \'buy_ticket\', \'way_of_buying\',\'internet_bilet\']);" href="http://internet-bilet.ua/events/item.html?event_id='.$id.'&partner=infopark"><div class=ticketsystem></div></a>';
        $html.='<div id="internet-bilet-55800">';
        $html.="<input type='button' class='provider_btn operatorbtn' value='Купить через Интернет-Билет' onclick='_gaq.push([\"_trackEvent\", \"buy_ticket\", \"way_of_buying\",\"internet_bilet\"]);window.open(\"http://internet-bilet.ua/events/item.html?event_id=".$event->field_inet_bilet_value."&partner=infopark\")'>";
        $html.='</div>';
        $html.='<script src="http://internet-bilet.ua/events/partner-js?event_id='.$id.'&partner=infopark&js_id=55800" type="text/javascript" charset="utf-8"></script>'; 
         $html.='<!-- /internet bilet/ -->';     
         $html.='<Script>setTimeout(function(){chk_ib()}, 1000);</script>';
         return $html;
        }
       /*
         function parse_xml($contents)
        {
            $contents=str_replace('<?xml version="1.0" encoding="utf-16"?>','<?xml version="1.0" encoding="utf-8"?>',$contents);
            #
           $xml=new SimpleXMLElement($contents);
          # print $contents." <hr>";
           return $xml;
        }
        */
}
?>
